package thread;

class RunnableDemo implements Runnable {

    @Override
    public void run() {
        while (true) {
            System.out.println("hello thread");
        }
    }
}

public class Demo2 {
    public static void main(String[] args) {
        RunnableDemo runnableDemo = new RunnableDemo();
        Thread thread = new Thread(runnableDemo);
        thread.start();
        while (true) {
            System.out.println("hello main");
        }
    }
}
